package field_method66;

public class Person {
    private int age;

    public void setAge(int age) {
        if (age >=0 && age <=100){
            this.age = age;
        }else {
            System.out.println("年龄输入不合法，请输入0到100之间的年龄。");
        }

    }

    public int getAge() {
        if (age >=0 && age<100){
            return age ;
        }else{
            return -1;
        }

    }
}
